﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZGRemote.Common.Message;
using ZGRemote.Common.Networking;
using ZGRemote.Common.Processor;

namespace ZGRemote.Server.Handler
{
    [CanProcessMessage(typeof(SystemInfoResponse))]
    public class SystemInfoDelegateHandler : HandlerBase<SystemInfoDelegateHandler>
    {
        public event Action<UserContext, SystemInfoResponse> GetSystemInfoResponse;

        public override void Excute(MessageBase message)
        {
            switch (message)
            {
                case SystemInfoResponse systemInfoResponse:
                    GetSystemInfoResponse?.Invoke(UserContext, systemInfoResponse);
                    break;
            }
        }

        public void GetSystemInfo()
        {
            SystemInfoRequest systemInfoRequest = new SystemInfoRequest();
            SendMessage(UserContext, systemInfoRequest);
        }
    }
}
